﻿<Page
    x:Class="KoolearnSample.Views.Exam.Demo"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:KoolearnSample.Views.Open"
    xmlns:control="using:KoolearnSample.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
	<Page.Resources>
		
	</Page.Resources>
    <Grid Style="{StaticResource BackgroundStyle}">
        <!--程序主窗体-->
        <Grid x:Name="grid1">
            <Grid.RowDefinitions>
                <RowDefinition Height="100"></RowDefinition>
                <RowDefinition></RowDefinition>
            </Grid.RowDefinitions>
            <Grid VerticalAlignment="Bottom">
                <StackPanel Orientation="Horizontal">
                    <Button Click="Button_Click_1" Style="{StaticResource BackButtonStyle}" Margin="36,0,36,18"></Button>
                    <TextBlock FontSize="40" VerticalAlignment="Center" Text="考试页面测试" Margin="10,0"></TextBlock>
                </StackPanel>
                <control:KoolearnNetwork HorizontalAlignment="Right"
                                         VerticalAlignment="Center"
                                         Margin="30,0"></control:KoolearnNetwork>
            </Grid>
            <Grid x:Name="grid" Grid.Row="1">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="300"></ColumnDefinition>
                    <ColumnDefinition></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <ListView Name="ListExamInfo"
                          CanDragItems="True"
                          IsItemClickEnabled="True"
                          ItemClick="ListExamInfo_ItemClick_1"
                          ItemTemplate="{StaticResource ListCategoryTemplate}"
                          ItemsSource="{Binding Categorys}"
                          Margin="30">
                    <ListView.ItemsPanel>
                        <ItemsPanelTemplate>
                            <VirtualizingStackPanel></VirtualizingStackPanel>
                        </ItemsPanelTemplate>
                    </ListView.ItemsPanel>
                </ListView>
                <Grid Name="GridExam" Grid.Column="1">
                    <GridView ItemsSource="{Binding Content}"
                              SelectionMode="None"
                              Margin="30">
                        <GridView.ItemTemplate>
                            <DataTemplate>
                                <Border BorderBrush="Gray" BorderThickness="10">
                                    <Grid Width="300" Height="500" Background="#ddd" Opacity="0.8">
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="0.8*"></RowDefinition>
                                            <RowDefinition></RowDefinition>
                                        </Grid.RowDefinitions>
                                        <TextBlock Margin="10" TextWrapping="Wrap" Text="{Binding Question}" Style="{StaticResource FontStyle}" FontSize="16"></TextBlock>
                                        <StackPanel Grid.Row="1">
                                            <ListView ItemsSource="{Binding AnswerList}"
                                                      SelectionMode="Single"
                                                      IsItemClickEnabled="True"
                                                      ItemClick="ListView_ItemClick_1">
                                                <ListView.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Tag="{Binding Correct}" FontSize="14" Margin="10"
                                                        TextWrapping="Wrap"
                                                        Style="{StaticResource FontStyle}"
                                                        Text="{Binding Answer}"></TextBlock>
                                                         
                                                    </DataTemplate>
                                                </ListView.ItemTemplate>
                                            </ListView>
                                        </StackPanel>
                                    </Grid>
                                </Border>
                            </DataTemplate>
                        </GridView.ItemTemplate>
                    </GridView>
                </Grid>

            </Grid>
        </Grid>
        <!--Loading控件-->
        <Popup Name="PopupLoading" IsOpen="True" 
               Width="236"
               Height="100"
               HorizontalAlignment="Center"
               VerticalAlignment="Center">
            <Grid>
                <control:KoolearnLoading></control:KoolearnLoading>
            </Grid>
        </Popup>
        <!--贴靠窗体-->
        <Grid Name="GridSnapped" Visibility="Collapsed">
            <TextBlock HorizontalAlignment="Center"
                       VerticalAlignment="Center"
                       FontSize="60"
                       Text="Koolearn"></TextBlock>
        </Grid>
        <!--视觉状态-->
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup>
                <VisualState x:Name="LanscapeFullScreen">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="grid1">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Visible</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="GridSnapped">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Collapsed</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>

                </VisualState>
                <VisualState x:Name="PortraitFullScreen"></VisualState>
                <VisualState x:Name="Filled"></VisualState>
                <VisualState x:Name="Snapped">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="grid1">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Collapsed</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="GridSnapped">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Visible</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>

</Page>